#coding: utf-8

from fabric.api import *

def install_requirements():
    """ update external dependencies on target host """
    require('code_root', provided_by=('developer', 'staging', 'production'))
    requirements = os.path.join(env.code_root, 'requirements')
    with cd(requirements):
        cmd = ['pip install']
        cmd += ['-E %(virtualenv_root)s' % env]
        cmd += ['--requirement %s' % os.path.join(requirements, 'apps.txt')]
        run(' '.join(cmd))